import Koa from 'koa'
import koaStatic from 'koa-static'
import { port } from './config/config.js'
import { registerRouter } from './component/router/index.js'
import { Rander } from './component/rander/index.js'
import { sync } from './component/db/index.js'

sync()

let app = new Koa()

app.use(koaStatic('./statics'))
app.use(Rander())
app.use(registerRouter(app))

app.listen(port,() => console.log(`Server is runing : http://127.0.0.1:${port}`))